package com.cqu.hhx.driver.mapper;

import com.cqu.hhx.driver.entity.Driver;
import com.cqu.hhx.driver.entity.forWeb.ChangeReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author DJ
 * @create 2020-05-24 21:34
 * 司机
 */
@Mapper
public interface DriverMapper {
    /**
     * 通过账户获取司机信息
     * @param account
     * @return
     */
    public Driver getDriverInfo(@Param("account") String account);

    /**
     * 通过Id获取司机信息
     * @param driverId
     * @return
     */
    public Driver getDriverInfoById(@Param("driverId") Long driverId);

    /**
     * 添加司机信息
     * @param driver
     * @return
     */
    public Integer addDriver(Driver driver);

    /**
     * 删除司机信息
     * @param driverId
     * @return
     */
    public int deleteDriver(@Param("driverId") Long driverId);

    /**
     * 重置密码
     * @param driverId
     * @return
     */
    public int resetPassword(@Param("driverId") Long driverId);

    /**
     * 更新司机信息
     * @param driverId
     * @param name
     * @param phone
     * @return
     */
    public int updateDriver(@Param("driverId") Long driverId,
                            @Param("name") String name,@Param("phone") String phone);

    /**
     * 更新司机账户余额
     * @param driverId
     * @param money
     * @return
     */
    public Integer updateDriverMoney(@Param("driverId") Long driverId,
                                     @Param("money") Float money);


}

